<div class='chall-panel panel panel-primary challenge'>
  <div class='panel-heading' id='{{chall.cid}}'>
    <h3 class='panel-title'>{{chall.name}}</h3>
    <span class='right'>
      <span class='points'>{{currentPoints}}</span>
      <span class='close-button btn btn-sm' data-dismiss='modal' ng-show='isModal'>&times;</span>
    </span>
  </div>
  <div class='chall-panel-body panel-body' ng-hide='chall.teaser'>
    <p ng-bind-html='chall.description|markdown' class='markdown'></p>
    <ul ng-show='chall.attachments' class='attachments'>
      <li ng-repeat='attachment in chall.attachments'>
        <a ng-href='/attachment/{{attachment.aid}}' target='_self'>{{attachment.filename}}</a>
      </li>
    </ul>
    <div>
      <!-- if solved -->
      <span class='alert alert-success solved ng-hide'
        ng-show='chall.answered'>Solved</span>
      <!-- if not solved -->
      <div ng-hide='chall.answered || !loggedIn'>
        <form name='challengeForm' ng-submit='submitChallenge()' class='submitForm'>
          <input type='hidden' name='cid' value='{{chall.cid}}'>
          <div class='form-group'>
            <label for='answer-{{chall.cid}}'>Answer</label>
            <input name='answer' class='form-control'
              id='answer-{{chall.cid}}' ng-model='chall.answer'
              required autocomplete='off'>
          </div>
          <input type='submit' ng-value='isAdmin() ? "Validate" : "Submit"'
            class='chall-submit btn btn-primary'
            ng-disabled='challengeForm.$invalid'>
        </form>
      </div> <!-- end submission -->
    </div>
    <div class='solvers' ng-show='chall.solves'>
      <h3 class='solve-head'>Solved By:</h3>
      <div class='solver-container' ng-repeat='ans in recent()'>
        <div class='solver-name'><a class='team-link' ng-click='closeModal("/teams/"+ans.team.tid)'>{{ans.team.name}}</a></div>
        <div class='solver-time'>{{timeFormat(ans.date)}}</div>
      </div>
      <div ng-show='chall.solves>minteams' class='show-container'>
        <div class='show-more btn btn-primary' ng-show='numteams>=0' ng-click='numteams=-1'>Show {{chall.solves-minteams}} other{{chall.solves==(minteams+1) ? '' : 's'}}</div>
        <div class='show-more btn btn-primary' ng-show='numteams<0'  ng-click='numteams=minteams' >Show Fewer</div>
      </div>
    </div> <!-- solvers -->
  </div> <!-- panel body -->
  <div class='chall-panel-body panel-body' ng-show='chall.teaser'>
    Prerequisites not met.
  </div>
</div> <!-- panel container -->
